﻿<!--
// (c) Norbert Huffschmid
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
-->

<Window x:Class="ShoutBox.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sd="clr-namespace:SpinDotters.Core;assembly=SpinDotters.Core"
        xmlns:coreRes="clr-namespace:ShoutBox.Core.Resources;assembly=ShoutBox.Core"
        SizeToContent="WidthAndHeight"
        FontSize="20"
        Background="Transparent"
        AllowsTransparency="True"
        WindowStyle="None"
        ResizeMode="NoResize"
        ShowInTaskbar="False"
        Topmost="True"
        IsVisibleChanged="Window_IsVisibleChanged"
        MouseLeftButtonDown="MainWindow_MouseLeftButtonDown"
        Closing="MainWindow_Closing"
        Loaded="Window_Loaded">

    <Window.Resources>
        <ResourceDictionary>

            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/ShoutBox;component/Resources/SpinningControls.xaml" />
                <ResourceDictionary Source="/ShoutBox;component/Resources/MicrophoneButton.xaml" />
                <ResourceDictionary Source="/ShoutBox;component/Resources/MinimizeButton.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <coreRes:Strings x:Key="LocStrings" />

        </ResourceDictionary>
    </Window.Resources>
    <Border CornerRadius="50"
            Background="LightSteelBlue"
            BorderThickness="6">
        <Border.BorderBrush>
            <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                <GradientStop Color="DimGray" Offset="0" />
                <GradientStop Color="Silver" Offset="0.5" />
                <GradientStop Color="DimGray" Offset="1" />
            </LinearGradientBrush>
        </Border.BorderBrush>
        <Grid>
            <StackPanel Orientation="Horizontal" MinWidth="430">
                <Button Style="{StaticResource MinimizeButton}"
                        VerticalAlignment="Center"
                        Margin="6,0,0,2"
                        Click="MinimizeButton_Click" />
                <sd:NumericUpDown Maximum="99"
                                  Value="{Binding Path=SessionMembers.Count}"
                                  ReadOnly="True"
                                  Margin="12,0,0,0"
                                  VerticalAlignment="Center"
                                  Style="{StaticResource SpinningControl}" />
                <sd:ComboBox x:Name="shoutBoxesComboBox"
                            Margin="12"
                            MinWidth="300" MinHeight="35"
                            VerticalAlignment="Center"
                            ItemsSource="{Binding Path=SessionMembers}"
                            IsEnabled="{Binding Path=IsNotShouting}"
                            DisplayMemberPath="Name"
                            Style="{StaticResource SpinningControl}" />
                <ToggleButton x:Name="speakButton"
                            Content="Speak"
                            IsEnabled="{Binding Path=SpeakButtonIsEnabled}"
                            Style="{StaticResource ShoutBoxButton}"
                            Width="80" Height="80"
                            Margin="6"
                            IsChecked="{Binding Path=IsShouting, Mode=TwoWay}" />
            </StackPanel>
            <TextBlock HorizontalAlignment="Left" VerticalAlignment="Bottom"
                       Margin="40,0,0,0"
                       FontSize="12"
                       Foreground="White"
                       Text="{Binding Path=VersionInfo}" />
        </Grid>
    </Border>
</Window>
